@import "normalize.css";
@import "./variables";

// reset
* {
  box-sizing: border-box;
  outline: none;
  font-family: Microsoft YaHei, Arial, Helvetica, sans-serif;
}

html {
  font-size: 12px;
}

// config
// 边框
@each $key, $direct in $space-directions {
  .border-#{$key} {
    border-#{$direct}: 1px solid map-get($colors, "gray");
  }
}
// 文本样式
@each $cKey, $color in $colors {
  .text-#{$cKey} {
    color: $color;
  }
  .bg-#{$cKey} {
    background-color: $color !important;
  }
}
// 文本位置
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var !important;
  }
}
// 文本大小
@each $sKey, $size in $font-sizes {
  .fs-#{$sKey} {
    font-size: $size * $font-base-size;
  }
}
//文本省略
.text-ellipsis {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
// flex;
.flex {
  display: flex;
}

.flex-1 {
  flex: 1;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

@each $key, $value in $flex-jc {
  .flex-jc-#{$key} {
    justify-content: $value;
  }
}

@each $key, $value in $flex-ai {
  .flex-ai-#{$key} {
    align-items: $value;
  }
}

// width && height

@each $key, $var in $scale {
  .w-#{$key} {
    width: $var;
  }
  .h-#{$key} {
    height: $var;
  }
}

// space
// padding && margin
@each $mpKey, $mp in $space-types {
  @each $sizeKey, $size in $space-sizes {
    .#{$mpKey}-#{$sizeKey} {
      #{$mp}: $size * $space-base-size;
    }
    .#{$mpKey}x-#{$sizeKey} {
      #{$mp}-left: $size * $space-base-size;
      #{$mp}-right: $size * $space-base-size;
    }
    .#{$mpKey}y-#{$sizeKey} {
      #{$mp}-top: $size * $space-base-size;
      #{$mp}-bottom: $size * $space-base-size;
    }
  }
  @each $direKey, $direc in $space-directions {
    @each $sizeKey, $size in $space-sizes {
      .#{$mpKey}#{$direKey}-#{$sizeKey} {
        #{$mp}-#{$direc}: $size * $space-base-size;
      }
    }
  }
}
